﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ServerFramework.Data
{
    public interface IRepository<TEntity>
        where TEntity : class
    {
        TEntity GetEntity(int id);
        IQueryable<TEntity> GetQuery();
        void Add(TEntity entity);
        void Update(TEntity entity);
        void Delete(TEntity entity);
        /// <summary>
        /// Abstraction on RIA's AttachAsModified extension method
        /// </summary>
        /// <param name="current"></param>
        /// <param name="original"></param>
        void AttachAsModified(TEntity current, TEntity original = null);
    }
}
